home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
quikcmd3.zip
/
BOOM.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1992-07-05
|
6KB
|
171 lines
; BOOM.LSP
;
; QUICK COMMAND Release 3.0
; BOOM.LSP is a module of QUICK COMMAND
; Copyright 1989, 90, 92 Dan Jincks
;
;
; This is SHAREWARE, it is NOT Public Domain software.
;
; This code or any part of this code may not be reproduced
; in any publication without prior written permission.
;
; Printed copy of this code or any part of this code may not
; be distributed without prior written permission.
;
; Printed copy may only be made for reference purposes by
; the end user.
;
;
; Dan Jincks
; Box 155A HCR 77
; Annapolis, MO 63620
;
;
;
; You are granted a limited license to use BOOM.LSP for a 30 day trial
; period. If you wish to continue using any or all of QUICK COMMAND after
; the trial period, you must become a registered user. As a registered
; user, you may use QUICK COMMAND on 1 workstation or terminal.
; Additional registrations must be bought for each additional workstation or
; terminal. To become a registered user, see QC3.DOC
;
;
; You may send copies of QUICK COMMAND to friends and associates if you abide
; by the following rules:
;
; 1. It may only be distributed in the original unmodified form.
; 2. All original files must be included.
; 3. No addition files may be added.
; 4. If other files will be on the same disk, QUICK COMMAND files must be in
; a library format such as ".ARC" called "QUICKCMD", or else be put alone
; in a subdirectory called "QUICKCMD".
; 5. You may not sell QUICK COMMAND or any part of it.
; 6. You are not allowed to charge more then $5 to cover the cost of copying
; and distribution.
; 7. You may not distribute any hard copy of the contents of QUICK COMMAND.
;
;
; These AutoLISP commands and functions are designed to save you time, and
; saving time means saving money. The registration fee is very modest
; compared to the savings, and much less expensive then typical third party
; AutoCAD software. Be sure to registar if you continue to use them.
;
;
; DAN
;
;
;
;
; AutoCAD and AutoLISP are registered trade marks of Autodesk Inc.
;
; ***************************************************************
;
; Begin BOOM.LSP
;
; BOOM function
;
(defun C:BOOM (/ SCA SCB SCC SCD SCE SCF SCH SCI SCJ SCN SCX SCY SCZ SSA SSB
SCK SCG SCK SSC SSD SC1 SC2 SCBX SCPX SCMX SCDX)(TERPRI)
(prompt " Explode Blocks, Plines, 3D Meshes, Dimensions within a window.")
(terpri)
(prompt " An UNDO MARK has been placed")
(terpri)
(setvar "cmdecho" 0)
(command "UNDO" "MARK")
(setq SC1 (getpoint "First corner of window"))(terpri)
(setq SC2 (getcorner SC1 "Second corner"))(terpri)
(setq SCBX nil SCPX nil SCMX nil SCDX nil SCN nil SCF 0 SCI 0 SCH 0 SCG 0)
(setq SSB (ssadd))(setq SSD (ssadd))
(initget "Yes No")
(setq SCBX (getkword "Explode Blocks? Y/N <Yes> "))(terpri)
(initget "Yes No")
(setq SCPX (getkword "Explode Polylines Y/N <Yes> "))(terpri)
(initget "Yes No")
(setq SCMX (getkword "Explode 3D Meshes? Y/N <Yes> "))(terpri)
(initget "Yes No")
(setq SCDX (getkword "Explode Dimensions? Y/N <Yes> "))(terpri)
(if (/= SCBX "No")(progn
(initget "Yes No")
(setq SCN (getkword "Explode nested blocks? Y/N <Yes> "))(terpri)
(if (/= SCN "No")(setq SCK 2)(setq SCK 1))
(grclear)
(prompt " Exploding blocks. ")(terpri)
(while (/= SCG SCK)
(setq SSA (ssget "W" SC1 SC2))
(setq SCA 0)
(setq SCE (ssname SSA SCA))
(while (/= SCE nil)
(setq SCB (entget SCE))
(setq SCD (cdr (assoc 0 SCB)))
(setq SCX (cdr (assoc 41 SCB)))
(setq SCY (cdr (assoc 42 SCB)))
(setq SCZ (cdr (assoc 43 SCB)))
(if (= SCD "INSERT")(progn
(if (= SCX SCY SCZ)
(progn
(command "EXPLODE" SCE)
(if (/= SCN "No")(progn
(setq SCC (entlast))
(ssadd SCC SSA)
))
)
(progn
(ssadd SCE SSB)
(if (= SCK 1)(setq SCI (1+ SCI))(setq SCI (+ 0.5 SCI)))
)
)
))
(setq SCA (1+ SCA))
(setq SCE (ssname SSA SCA))
)
(setq SCG (1+ SCG))
)
)(grclear)
)
(if (or (/= SCPX "No")(/= SCDX "No")(/= SCMX "No"))(progn
(setq SSC (ssget "W" SC1 SC2))
(setq SCA 0)
(setq SCE (ssname SSC SCA))
(prompt " Exploding -- ")
(if (/= SCPX "No")(prompt "Plines "))
(if (/= SCDX "No")(prompt "Dimensions "))
(if (/= SCMX "No")(prompt "3D Meshes "))
(terpri)
(while (/= SCE nil)
(setq SCB (entget SCE))
(setq SCD (cdr (assoc 0 SCB)))
(setq SCJ (cdr (assoc 71 SCB)))
(if (= SCD "INSERT")(progn
(setq SCH 1)
(ssadd SCE SSD)
))
(if (or (and (= SCJ 0)(/= SCPX "No")(= SCD "POLYLINE"))
(and (/= SCDX "No")(= SCD "DIMENSION"))
(and (> SCJ 0)(/= SCMX "No")(= SCD "POLYLINE")))
(command "EXPLODE" SCE)
)
(setq SCA (1+ SCA))
(setq SCE (ssname SSC SCA))
)
))
(setq SCI (fix SCI))
(if (/= SCI 0)(progn (princ SCI)
(prompt " BLOCKS WITH UNEQUAL X Y Z SCALE COULD NOT BE EXPLODED")(terpri)
(prompt " Rejected Blocks are highlighted. PRESS ENTER ")(terpri)
(command "SELECT" SSB pause)
))
(prompt "Area has been Exploded.")
(if (= SCH 1)(progn
(prompt " Unexploded blocks are highlighted. PRESS ENTER.")
(command "SELECT" SSD pause)
))
(terpri)
(prompt "Exploded objects are displayed. PRESS ENTER ")
(command "LIST" pause "REDRAW")
(prompt "Use UNDO BACK to restore drawing.")
(setvar "cmdecho" 1)(princ)
)
;
; End Boom